/*
 * @Author: wangtao
 * @Date: 2020-08-20 14:07:42
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-05-26 17:19:25
 * @Description:
 */

import React from 'react';
import {
  View,
  StyleSheet,
  Text,
} from 'react-native';
import { } from '@/images';
import { } from '@/common';
import {
  screenWidth,
  mainBgColorWhite,
  px2dp,
  fontColorBlack,
  fontColorSecDeepGray,
} from '@/styles';
import CameraCard from './camera-card';

export default class FaceCer extends React.PureComponent {
  render() {
    const { selectImg, faceImgId } = this.props;
    return (
      <View style={styles.faceFloor}>
        <Text style={styles.title}>
          人脸信息
          <Text style={{ color: fontColorSecDeepGray, fontSize: px2dp(28) }}>
            (必填，请上传自拍照片)
          </Text>
        </Text>
        <CameraCard
          title='点击上传人脸信息'
          selectImg={() => selectImg('faceImgId')}
          type={faceImgId}
          exempleImg='https://xmgj2020-prod.oss-cn-chengdu.aliyuncs.com/carSketchMap/fa8e6e4704b0e787f51f5eee7a77af646f0a8ab7.jpg'
        />
        {/* <TouchableOpacity onPress={() => selectImg('faceImgId')}>
          <ImageBackground style={styles.bgStyle} source={faceCard}>
            {faceImgId ? (
              <Image
                source={{uri: faceImgId}}
                resizeMode="stretch"
                style={styles.img}
              />
            ) : (
              <Image
                source={iconCamera}
                resizeMode="stretch"
                style={styles.cameraImg}
              />
            )}
          </ImageBackground>
        </TouchableOpacity> */}

        {/* <Text style={styles.desc}>点击拍摄或上传人脸识别信息</Text> */}
      </View>
    );
  }
}

const styles = StyleSheet.create({
  faceFloor: {
    width: screenWidth,
    backgroundColor: mainBgColorWhite,
    marginTop: px2dp(24),
    padding: px2dp(32),
    alignItems: 'center',
  },
  title: {
    fontSize: px2dp(32),
    color: fontColorBlack,
    fontWeight: 'bold',
    textAlign: 'left',
    width: '100%',
  },
  desc: {
    fontSize: px2dp(28),
    color: fontColorSecDeepGray,
    textAlign: 'center',
  },
  bgStyle: {
    width: px2dp(331),
    height: px2dp(202),
    marginVertical: px2dp(32),
    justifyContent: 'center',
    alignItems: 'center',
  },
  cameraImg: {
    width: px2dp(144),
    height: px2dp(144),
  },
  img: {
    width: '100%',
    height: '100%',
  },
});
